﻿#ifndef YUVVIDEOPLAYWIDGET_H
#define YUVVIDEOPLAYWIDGET_H

/*******************************************************************
 *  Copyright(c) 2018-2018 A single spark
 *  All rights reserved.
 *
 *  文件名称:   yuvvideoplaywidget.h
 *  简要描述:   视频播放与控制
 *
 *  修改日期:   2018.03.09
 *  作者:      小罗
 *  邮箱:
 *  说明:
 ******************************************************************/

#include "yuvwidget.h"

class QPushButton;
class QProgressBar;
class QLabel;

class YUVDispalyWidget;

class YUVVideoPlayWidget : public YUVWidget
{
    Q_OBJECT
public:
    explicit YUVVideoPlayWidget(QWidget *parent = Q_NULLPTR);
    ~YUVVideoPlayWidget();

signals:

public slots:
    void resetFilePath(QString filePath);

private slots:
    void playFileInit(QString filePath);
    void enterPreFrame();
    void enterNextFrame();
    void startPlay();
    void stopPlay();
    void setProgressValue(quint64 nCurFrameIndex, quint64 nTotalFrames);

private:
    void changeCheckedButton(QPushButton *pBtn);

private:
    YUVDispalyWidget *m_pDisplayWidget;

    QProgressBar *m_pProgressBar;

    QPushButton *m_pPreFrameButton;
    QPushButton *m_pNextFrameButton;
    QPushButton *m_pPlayButton;
    QPushButton *m_pStopButton;
    QPushButton *m_pBtnPrev;

    QLabel  *m_pShowRateLabel;

    bool m_bIsPlaying;

    QString m_filePath;
};

#endif // YUVVIDEOPLAYWIDGET_H
